/*
 * @Author: xxx
 * @Description: 工具类
 */

import dayjs from 'dayjs'
import _ from 'lodash'

class UtilHelper {
  dateFilterYMDHMS(date) {
    return dayjs(date).format('YYYY-MM-DD HH:mm:ss')
  }

  dateFilterYMD(date) {
    return dayjs(date).format('YYYY-MM-DD')
  }

  cloneDeep(list) {
    let copyList = _.cloneDeep(list)
    return copyList
  }

  //密码加密
  asswordEncryption(value) {
    return value.setPublicKey(`-----BEGIN PUBLIC KEY-----
    MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKdKk67IWN0Qd94HuSlqbx4cqMY
    lq31Cyp4BUe2ByqkZlymuWlFsr4byVcPArPcz2ReJGUVaV3dLOH5A8c/od
    msCAwEAAQ==
    -----END PUBLIC KEY-----`)
  }
}

export default new UtilHelper()
